﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace SelfServiceWriteSystem
{
    /// <summary>
    /// PassWrods.xaml 的交互逻辑
    /// </summary>
    public partial class PassWrods : Window
    {
        public PassWrods()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            passwordBox.Clear();
        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            passwordBox.Password = passwordBox.Password.Substring(0, passwordBox.Password.Length - 1);
        }

        private void Button_Click_2(object sender, RoutedEventArgs e)
        {
            string p = File.ReadAllText("passwordBox.txt");
            if (p.Trim() == passwordBox.Password)
            {
                DialogResult = true;
            }
            else
            {
                MessageBox.Show("密码错误！非工作管理人员请不要进行非法操作！谢谢合作！", "警告");
            }
        }

        private void Button_Click_Input(object sender, RoutedEventArgs e)
        {
            var b = sender as Button;
            passwordBox.Password += b.Content;
        }

        private void Button_Click_3(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
        }
    }
}
